class DeviceFeaturesController < ApplicationController
  # GET /device_features
  # GET /device_features.xml
  def index
    @devicefeatures = DeviceFeature.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @devicefeatures }
    end
  end

  # GET /device_features/1
  # GET /device_features/1.xml
  def show
    @devicefeature = DeviceFeature.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @devicefeature }
    end
  end

  # GET /device_features/new
  # GET /device_features/new.xml
  def new
    @devicefeature = DeviceFeature.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @devicefeature }
    end
  end

  # GET /device_features/1/edit
  def edit
    @devicefeature = DeviceFeature.find(params[:id])
  end

  # POST /device_features
  # POST /device_features.xml
  def create
    @devicefeature = DeviceFeature.new(params[:device_feature])

    respond_to do |format|
      if @devicefeature.save
        flash[:notice] = 'DeviceFeature was successfully created.'
        format.html { redirect_to(@devicefeature) }
        format.xml  { render :xml => @devicefeature, :status => :created, :location => @devicefeature }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @devicefeature.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /device_features/1
  # PUT /device_features/1.xml
  def update
    @device_feature = DeviceFeature.find(params[:id])

    respond_to do |format|
      if @device_feature.update_attributes(params[:device_feature])
        flash[:notice] = 'DeviceFeature was successfully updated.'
        format.html { redirect_to(@device_feature) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @device_feature.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /device_features/1
  # DELETE /device_features/1.xml
  def destroy
    @device_feature = DeviceFeature.find(params[:id])
    @device_feature.destroy

    respond_to do |format|
      format.html { redirect_to(device_features_url) }
      format.xml  { head :ok }
    end
  end
end
